package com.forum.domain;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.HashSet;
import java.util.Set;
import java.util.Date;

import antlr.collections.impl.Vector;

/**
 * Reply entity. @author MyEclipse Persistence Tools
 */

public class Reply implements java.io.Serializable {

        // Fields

        private Integer id;
        private User userByUserFromId;
        private Topic topic;
        private User userByUserid;
        private Timestamp time;
        private String content;
        private Set reminds = new HashSet(0);

        // Constructors

        /** default constructor */
        public Reply() {
        }

        /** minimal constructor */
        public Reply(User userByUserFromId, Topic topic, User userByUserid,
                        Timestamp time, String content) {
                this.userByUserFromId = userByUserFromId;
                this.topic = topic;
                this.userByUserid = userByUserid;
                this.time = time;
                this.content = content;
        }

        /** full constructor */
        public Reply(User userByUserFromId, Topic topic, User userByUserid,
                        Timestamp time, String content, Set reminds) {
                this.userByUserFromId = userByUserFromId;
                this.topic = topic;
                this.userByUserid = userByUserid;
                this.time = time;
                this.content = content;
                this.reminds = reminds;
        }

        // Property accessors

        public Integer getId() {
                return this.id;
        }

        public void setId(Integer id) {
                this.id = id;
        }

        public User getUserByUserFromId() {
                return this.userByUserFromId;
        }

        public void setUserByUserFromId(User userByUserFromId) {
                this.userByUserFromId = userByUserFromId;
        }

        public Topic getTopic() {
                return this.topic;
        }

        public void setTopic(Topic topic) {
                this.topic = topic;
        }

        public User getUserByUserid() {
                return this.userByUserid;
        }

        public void setUserByUserid(User userByUserid) {
                this.userByUserid = userByUserid;
        }

        public Timestamp getTime()
        {
                return this.time;
                
        }
        public String getDateTime() {
                
                SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
                
                return df.format(this.time);
        }
        public int getDay(){
                int  day = this.time.getDate();
                return day;
                
        }
        public String getMonth(){
                int month = this.time.getMonth();
                String[] Mons = {"Jan","Feb","Mar","April","May","June","July","Aug","Sept","Oct","Nov","Dec"};
                return Mons[month-1];
        }

        public void setTime(Timestamp time) {
                this.time = time;
        }

        public String getContent() {
                return this.content;
        }

        public void setContent(String content) {
                this.content = content;
        }

        public Set getReminds() {
                return this.reminds;
        }

        public void setReminds(Set reminds) {
                this.reminds = reminds;
        }

}